<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ include file="../header.jsp"%>
<h2>账户列表</h2>
<a href="useradd.jsp">新增账户</a><br>
<table>
    <tr>
        <td>账号</td>
        <td>姓名</td>
        <td>专业</td>
        <td>操作</td>
    </tr>
<c:forEach items="${sessionScope.users}" var="u">
    <tr>
        <td>${u.name}</td>
        <td>${u.trueName}</td>
        <td>${u.major}</td>
        <td>
            <a href="useredit.do?uid=${u.uid}">编辑</a>
            <a href="userdel.do?uid=${u.uid}" onclick="return del()">删除</a>
        </td>
    </tr>
</c:forEach>
</table>
<script type="text/javascript">
    function del(){
        if(!confirm("确认要删除？")){
            return false;
        }
    }
</script>
</body>
</html>
